#ifndef __STATE_MANAGER_H__
#define __STATE_MANAGER_H__

#include "cam_tele.h"
#include "cam_wide.h"
#include "system.h"
#include "astro.h"
#include "rgb_power.h"
#include "dwarf2_panorama.h"
#include "focus.h"
#include "track.h"

#include <iostream>
#include <mutex>

class StateManager {
public:
    StateManager(StateManager &other) = delete;
    void operator=(const StateManager &) = delete;
    static StateManager* GetInstance();

    bool getCamTeleState();
    CamTelePhotoState getCamTelePhotoState();
    CamTeleTimelapseState getCamTeleTimelapseState();
    CamWidePhotoState getCamWidePhotoState();
    int checkEle();
    int checkCloseCamera();

protected:
    StateManager();
    ~StateManager();

public:
    Astro& astro_ = Astro::astro();
    CamTele cam_tele_;
    CamWide cam_wide_;
    System system_;
    RgbPower rgb_power_;
    Dwarf2Panorama panorama_;
    Focus focus_;
    Track tracker_;

private:
    static StateManager* pinstance_;
    static std::mutex singleton_mutex_;

    
    
};

#endif